Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera] Fix disposed exceptions for the camera example on iOS #4692

Closed

Conversation

AlexV525
Copy link
Member

@AlexV525 AlexV525 commented Jan 25, 2022

No CHANGELOG change: only affects the example.
No version change: only affects the example.

Related to flutter/flutter#97199.

Controllers were given to the field aggressively, which cause race conditions when initializing controllers. Now the code will remove the references ASAP when a controller has been disposed.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard

This comment has been minimized.

@AlexV525
Copy link
Member Author

Test result without the fix: image

@AlexV525 AlexV525 requested a review from hellohuanlin January 26, 2022 05:52
@AlexV525 AlexV525 force-pushed the fix-camera-example-exceptions branch 2 times, most recently from 5897588 to 6594de8 Compare January 26, 2022 06:17
@hellohuanlin
Copy link
Contributor

Hi, can you add more details in the description? is it to hide the permission bug from the example project? (if that's the case it is probably better not to hide it so we know there's a bug there)

@AlexV525
Copy link
Member Author

Hi, can you add more details in the description? is it to hide the permission bug from the example project? (if that's the case it is probably better not to hide it so we know there's a bug there)

@hellohuanlin Updated. It's more like a race conditions issue, and it could happen other than the permission issue.

@AlexV525 AlexV525 force-pushed the fix-camera-example-exceptions branch from 6594de8 to 5b3d3ff Compare January 27, 2022 03:50
@hellohuanlin
Copy link
Contributor

@hellohuanlin Updated. It's more like a race conditions issue, and it could happen other than the permission issue.

Will this PR hide the permission issue mentioned in flutter/flutter#97199?

@AlexV525
Copy link
Member Author

AlexV525 commented Jan 27, 2022

Will this PR hide the permission issue mentioned in flutter/flutter#97199?

Indeed, we can hold this though.

@stuartmorgan
Copy link
Contributor

No CHANGELOG change: only affects the example.

We generally changelog for example-only changes; see the discussion in the link for that PR item. (Otherwise the bot would be configured not to require the override for that case.)

@AlexV525 AlexV525 marked this pull request as draft January 28, 2022 15:36
@Hixie
Copy link
Contributor

Hixie commented Apr 5, 2022

What's the status of this PR?

@AlexV525
Copy link
Member Author

AlexV525 commented Apr 6, 2022

What's the status of this PR?

I'm holding this and see if it's still necessary after @hellohuanlin apply fixes to flutter/flutter#97199.

@hellohuanlin
Copy link
Contributor

since this PR hides the bug in the example code, it may not be a good idea to land it

@AlexV525 AlexV525 closed this Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants